/*
* Conditions Of Use
*
* This software was developed by employees of the Sigmatrix(Beijing) Corporation.
* This software is provided by sigmatrix as a service and is expressly
* provided "AS IS."  Sigmatrix MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
* AND DATA ACCURACY.  Sigmatrix does not warrant or make any representations
* regarding the use of the software or the results thereof, including but
* not limited to the correctness, accuracy, reliability or usefulness of
* the software.
*
* Permission to use this software is contingent upon your acceptance
* of the terms of this agreement.
*
*/
package com.sigmatrix.h5.dao;

import java.util.List;

import com.sigmatrix.h5.dao.impl.common.BaseDao;
import com.sigmatrix.h5.dto.InStorageDetailData;
import com.sigmatrix.h5.entity.InStorageDetail;
import com.sigmatrix.h5.exception.DaoException;

/**
 *@ClassName: InStorageDetailDao
 *@Description: 入库单详情数据库操作接口
 *@author youjun
 *@date 2017-07-06 14:21:21
 */
public interface InStorageDetailDao extends BaseDao<InStorageDetail> {

	/**
	 *@Title: findById
	 *@Description: 根据主键查找入库单详情
	 *@return InStorageDetail
	 *@author youjun
	 *@date 2017-07-06 14:21:21
	 *@param id
	 *@param enterpriseCode
	 *@throws DaoException 
	 */
	InStorageDetail findById(final Long id, final String enterpriseCode) throws DaoException;
	
	/**
	 *@Title: findByInStorageId
	 *@Description: 根据主要入库单查询明细
	 *@return List<InStorageDetail>
	 *@date 2017年9月11日 下午6:33:36
	 *@param inStorageId
	 *@param eseCode
	 *@throws DaoException
	 */
	List<InStorageDetail> findByInStorageId(final Long inStorageId, final String eseCode) throws DaoException;
	
	/**
	 *@Title: updateById
	 *@Description: 更新码内容和实际数量
	 *@return int
	 *@date 2017年9月27日 上午9:39:41
	 *@param eseCode
	 *@param detailId
	 *@param operCont
	 *@param actualNum
	 *@throws DaoException
	 */
	int updateById(final String eseCode,final Long detailId,final String operCont,
			final Integer actualNum,final Integer status) throws DaoException;
	/**
	 * 
	 *@Title: updateById
	 *@Description: TODO()
	 *@return int
	 *@author gaomingkai
	 *@date 2018年3月21日 下午5:47:59
	 *@param eseCode
	 *@param detailId
	 *@param operCont
	 *@param actualNum
	 *@param status
	 *@return
	 *@throws DaoException
	 */
	int updateById(final String eseCode,final Long detailId,final String operCont,
			final Integer actualNum,final Integer status,final Integer planNum) throws DaoException;
	
	/**
	 *@Title: sumActualNumByLevel
	 *@Description: TODO()
	 *@return int
	 *@date 2017年9月27日 下午5:17:40
	 *@param eseCode
	 *@param inStorageId 主入库单号
	 *@param level 级别
	 *@throws DaoException
	 */
	int sumActualNumByLevel(final String eseCode,final Long inStorageId,final Integer level) throws DaoException;
	
	/**
	 *@Title: findByPage
	 *@Description: 分页查询入库单详情列表
	 *@return List<inStorageDetail>
	 *@author youjun
	 *@date 2017-07-06 14:21:21
	 *@param pageNo
	 *@param pageSize
	 *@param inStorageDetail
	 *@param enterpriseCode
	 *@return
	 */
	List<InStorageDetail> findByPage(final int pageNo, final int pageSize, InStorageDetail inStorageDetail, final String enterpriseCode) throws DaoException;
	
	/**
	 *@Title: getCountByCondition
	 *@Description: 根据条件查询入库单详情总数
	 *@return int
	 *@author youjun
	 *@date 2017-07-06 14:21:21
	 *@param inStorageDetail
	 *@param enterpriseCode
	 *@return
	 */
	int getCountByCondition(final InStorageDetail inStorageDetail, final String enterpriseCode) throws DaoException;
	
	/**
	 *@Title: findListByCondition
	 *@Description: 根据条件查找入库单详情列表
	 *@return List<InStorageDetail>
	 *@author youjun
	 *@date 2017-07-06 14:21:21
	 *@param inStorageDetail
	 *@param enterpriseCode
	 *@return
	 *@throws DaoException
	 */
	List<InStorageDetail> findListByCondition(final InStorageDetail inStorageDetail, final String enterpriseCode) throws DaoException;

	/**
	 *@Title: batchSave
	 *@Description: 批量保存出库单详情
	 *@return int
	 *@author youjun
	 *@date 2017年7月6日 下午3:56:04
	 *@param detailList
	 *@param enterpriseCode
	 * @throws DaoException 
	 */
	int batchSave(final List<InStorageDetail> detailList, final String enterpriseCode) throws DaoException;

	/**
	 *@Title: findPartColumnListByCondition
	 *@Description: 根据条件查找入库单详情部分字段列表
	 *@return List<InStorageDetailData>
	 *@author youjun
	 *@date 2017年7月7日 下午9:30:03
	 *@param inStorageDetail
	 *@param enterpriseCode
	 *@return
	 */
	List<InStorageDetailData> findPartColumnListByCondition111(final InStorageDetail inStorageDetail, final String enterpriseCode) throws DaoException;

	/**
	 *@Title: closeByInStorageId
	 *@Description: TODO()
	 *@return int
	 *@author youjun
	 *@date 2017年8月23日 下午5:20:39
	 *@param inStorageId
	 *@param canCloseStatusList
	 *@param enterpriseCode
	 */
	int closeByInStorageId(final Long inStorageId,final List<Integer> canCloseStatusList,final String enterpriseCode) throws DaoException;
	
	
	/**
	 *@Title: findByCondition
	 *@Description: 查询入库单明细  根据入库单  产品id 级别 查询
	 *@return List<InStorageDetail>
	 *@date 2017年9月22日 下午5:48:05
	 *@param eseCode
	 *@param inStorageId
	 *@param productId
	 *@param level
	 *@throws DaoException
	 */
	List<InStorageDetail>  findByCondition(final String eseCode,final Long inStorageId,final Integer productId,final Integer level) throws DaoException;
	
	
}
